<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <button id="btn">暂停切换背景色</button>
</body>
<script src="../js/utils.js"></script>
<script>

    var time = setInterval(function(){
        console.log(randomColor())
        document.body.style.background =randomColor();
    },500)

    btn.onclick = function(){
        clearInterval(time)
    }
</script>
</html>